﻿using Host.DB;
using Host.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Host.CTR
{
    class BatteryCtr
    {
        private DBBattery dbb = new DBBattery();
        private DBTest dbt = new DBTest();

        public BatteryCtr()
        {

        } 
        
        public Battery getBattery(string ID)
        {
            return dbb.getBattery(ID);
        }

        public List<Battery> getAllBattery()
        {
            return dbb.getAllBattery();
        }

        public void addBattery(Location l, bool booked, bool charged)
        {
            Battery b = new Battery();
            b.location = l;
            b.booked = booked;
            b.charged = charged;

            dbb.addBattery(b);
        }

        public void editBattery(Battery b)
        {
            dbb.editBattery(b);
        }

        public void deleteBattery(Battery b)
        {
            dbb.deleteBattery(b);
        }

        public List<Battery> getBatteryByLocation(Location l)
        {
            return dbb.getBatteryByLocation(l);
        }
    }
}
